package com.softa.web.controller.custom;

import com.softa.annotation.CurrentUser;
import com.softa.dao.model.SysUser;
import com.softa.service.system.SysMessageService;
import com.softa.web.controller.base.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by yangl on 2017/8/17.
 */
@Controller
@RequestMapping("/custom/message")
public class CustomMessageController extends BaseController{

     @Autowired
    private SysMessageService sysMessageService;

    /**
     * 获取登陆人消息总数
     * @param loginUser 登陆人
     * @return
     */
    @RequestMapping(value = "/getusermessage", method = RequestMethod.GET)
    @ResponseBody
    public Long update(@CurrentUser SysUser loginUser) {
        return sysMessageService.getMessageCountByParam(loginUser.getId());
    }
}
